// 这里开始使用 pinia
import { defineStore} from "pinia";
import {ref} from 'vue'

// 导入model文件
import { LoginModel } from '@/models/login'
// 引入api
import {LoginApi} from '@/util/api'

export const storeLoginData = defineStore('login', ()=>{
    const loginResult = ref<LoginModel[]>([])
    const storeLoginRequest = async () => {
        const result = await LoginApi()
        console.log("获取拿到的结果", result)
        loginResult.value = result.data
    }
    return { loginResult, storeLoginRequest}
})
